<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>附件</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no"/>
    <meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <link rel="stylesheet" href="/static/admin/static/component/pear/css/pear.css" />
    <link href="/static/public/libs/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="/static/admin/pages/attach/css/attach-list.css?v=#(version)" rel="stylesheet"/>
</head>
<body class="pear-container">
<div class="p-container">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="p-search-panel">
                <form class="layui-form">
                    <div class="layui-input-inline"  style="display: none;">
                        <select lay-verify="" type="hidden"></select>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">文件名:</label>
                            <div class="layui-input-inline">
                                <input type="text" name="name" placeholder="请输入文件名" id="name"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">文件类型:</label>
                            <div class="layui-input-inline">
                                <select name="type" id="type">
                                    <option value=""></option>
                                    <option value="img">图片</option>
                                    <option value="video">视频</option>
                                    <option value="other">其他</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button id="queryBtn" class="pear-btn pear-btn-md pear-btn-primary" type="button">
                                <i class="fa fa-search" aria-hidden="true"></i>
                                查询
                            </button>
                            <button id="addBtn" class="pear-btn pear-btn-md pear-btn-primary" type="button">
                                <i class="fa fa-plus" aria-hidden="true"></i>
                                上传附件
                            </button>

                            <button id="batchDeleteBtn" class="pear-btn pear-btn-md pear-btn-danger" type="button">
                                <i class="fa fa-trash" aria-hidden="true"></i>
                                批量删除
                            </button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="p-table-box layui-row layui-col-space10" id="tableBox">
            </div>
            <div id="tabBoxPage"></div>
        </div>
    </div>

</div>

<script id="tableTpl" type="text/html">
    #[[{{#  layui.each(d, function(index, item){ }}
        {{#  if(item.type === 'img'){ }}
            <div class="layui-col-xs6 layui-col-sm3 layui-col-md2">
                <input type="checkbox" name="attach[{{item.id}}]" class="p-attach-check" id="{{item.id}}">
                <div class="p-attach-card" onclick="editData('{{item.id}}')">
                    <img src="/static/public/images/loading.gif" lay-src="{{ item.url }}" alt="{{ item.name }}" class="p-attach-img">
                    <div class="p-attach-info">{{item.name}}</div>
                </div>
            </div>
        {{# } else{ }}
            <div class="layui-col-xs6 layui-col-sm3 layui-col-md2">
                <input type="checkbox" name="attach[{{item.id}}]" class="p-attach-check" id="{{item.id}}">
                <div class="p-attach-card" onclick="editData('{{item.id}}')">
                    <div class="p-attach-suffix">{{item.suffix.slice(1)}}</div>
                    <div class="p-attach-info">{{item.name}}</div>
                </div>
            </div>
        {{# } }}
    {{#  }); }}
    {{#  if(d === null || d.length === 0){ }}
    暂无数据
    {{#  } }}]]#
</script>
<script src="/static/public/libs/layui-v2.5.6/layui/layui.js"></script>
<script src="/static/admin/static/component/pear/pear.js"></script>
<script src="/static/public/js/common.js?v=#(version)"></script>
<script src="/static/admin/pages/attach/js/attach_list.js?v=#(version)"></script>
</body>
</html>